<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>登录</title>
	<link href="<?php echo G_STATIC_URL; ?>/css/default/index.css" rel="stylesheet" />
	<link href="<?php echo G_STATIC_URL; ?>/css/default/global.css?v=1" rel="stylesheet" />


	<script src="<?php echo G_STATIC_URL; ?>/js/jquery-2.1.1.min.js"></script>
	<link rel="stylesheet" href="<?php echo G_STATIC_URL; ?>/js/layer/layer.css" />
	<script src="<?php echo G_STATIC_URL; ?>/js/layer/layer.js"></script>


	<link rel="stylesheet" href="<?php echo G_STATIC_URL; ?>/css/bootstrap.min.css">
	<link rel="stylesheet" href="<?php echo G_STATIC_URL; ?>/css/font-awesome.min.css">
	<link rel="stylesheet" href="<?php echo G_STATIC_URL; ?>/css/main.css">
	<link rel="stylesheet" href="<?php echo G_STATIC_URL; ?>/css/animate.css">
	<link rel="stylesheet" href="<?php echo G_STATIC_URL; ?>/css/responsive.css">


</head>
<body style="background-color: #f2f6fa;">
<header>
	<div class="container">
		<div class="row">
			<div class="col-md-3 col-xs-6 col-sm-3">
				<a href="/?/explore/index/" class="logo">
					<img src="<?php echo G_STATIC_URL; ?>/css/images/logo.png" alt="">
				</a>
			</div>


		</div>
	</div>
</header>

    <br/>
	<br/>
	<br/>

<div class="content">
	<div class="logo_content">
		<div class="login_tab">
			<span class="login_accounts active">手机验证码登录</span>
			<span class="login_accounts">二维码登录</span>
		</div>
		<div class="login-if">
			<div class="input_main">
				<div class="input_phone">
					<span class="left_it"><img src="<?php echo G_STATIC_URL; ?>/common/mphoneicon.png" alt="">手机号：</span>
					<span class="input_tt"><input type="text" name="phone" id="phonenum" placeholder="请输入手机号"></span>
				</div>
				<div class="input_phone">
					<span class="left_it"><img src="<?php echo G_STATIC_URL; ?>/common/codeicon.png" alt="">验证码：</span>
					<span class="input_cd"><input type="text" id="codenum" placeholder="输入验证码"></span>
					<span class="bt_cd" onclick="send_code();">获取验证码</span>
				</div>
			</div>
			<div class="login_btn">
				<span class="lgbtn" id="phone_login">立即登录</span>
			</div>
			<div class="pt_tt">
				<span class="pt1">还没账号？</span>
				<a href=""><span class="pt2">立即注册</span></a>
			</div>
			<br/>
		</div>
		<div class="login-if hidden">
			<div class="input_main">
				<div class="input_phone">
					<span class="left_it"><img src="<?php echo G_STATIC_URL; ?>/common/mphoneicon.png" alt="">账号：</span>
					<span class="input_tt"><input type="text" id="accountnum" placeholder="输入手机号"></span>
				</div>
				<div class="input_phone">
					<span class="left_it"><img src="<?php echo G_STATIC_URL; ?>/common/paswdicon.png" alt="">密码：</span>
					<span class="input_tt"><input type="text" id="passwordnum" placeholder="输入密码"></span>
				</div>
			</div>
			<div class="forget"><a href="">忘记密码？</a></div>
			<div class="login_btn">
				<span class="lgbtn" id="account_login">立即登录</span>
			</div>
			<div class="pt_tt">
				<span class="pt1">还没账号？</span>
				<a href=""><span class="pt2">立即注册</span></a>
			</div>
			<br/>
		</div>

	</div>

</div>

<script>
	$(function(){
		clickinit();
		
		$('#phone_login').click(function () {

			var phone = $('#phonenum').val();
			var code = $('#codenum').val();

			$.post('/?/account/ajax/login_by_phone/',{"phone":phone,"code":code},function (result) {

				if(result.errno == 1){

					window.location.href = result.rsm.url;
				}else{
					showMsg(result.err);
				}
			},'json');

		});
	});
	function clickinit(){
		$(".login_accounts").click(function(){
			$(".login_accounts").removeClass('active');
			$(this).addClass('active');
			var num=$(this).index();
			$(".login-if").addClass('hidden');
			$(".login-if").eq(num).removeClass('hidden');

		});
	}

	/**
	 * 显示消息
	 */
	function showMsg(msg,time) {
		layer.open({
			content: msg ,
			time: time ? time : 2 //3秒后自动关闭
		});
	}
	</script>
</body>
</html>